package com.demo.modalframe3.listener;

import com.demo.modalframe3.utils.AppendTextFrame;

import javax.swing.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowStateListener;

public class FrameStateListener implements WindowStateListener {

    @Override
    public void windowStateChanged(WindowEvent e) {
        JFrame frame = (JFrame)e.getSource();
        if (frame instanceof AppendTextFrame) {
            ((AppendTextFrame)frame).appendText2TextPane(e.paramString());
        }
    }
}
